﻿@{
    ViewBag.Title = Helper.BlogName + " : " + Helper.BlogDescription;
}

@model PagedList<Pulog.Models.Post>

@section MainContent {

    @foreach (Pulog.Models.Post p in this.ViewData.Model)
    { 
        <article class="post">
                <h3><a href="/Posts/@p.slug">@p.title</a></h3>
            
            <footer class="postmeta">作者:@p.User.userName 发表于:@p.pubTime.ToString("yyyy年MM月dd日") -- @Helper.GetDateDifference(p.pubTime) | 分类: <a href="/Category/@p.Category.categoryName">@p.Category.categoryName</a>
            | <a href="/Posts/Show/@p.postID.ToString()#comments">Comments: @p.Comments.Count </a> | Views: @p.views </footer> <!-- end post meta -->
                <p>
                    @MvcHtmlString.Create(p.content)
                </p>
        </article> 
    }

    <div id="paging">
        @{Html.RenderPartial("Pagination", new PagedList<Pulog.Models.Post>(new Pulog.Models.PulogDataContext().Posts, Model.PageIndex.Value, 10));}
    </div>
}